<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const target = {
      name: 'xxx',
      age: {
        age2: {
          age3: 18
        }
      }
    }
    const handler = {
      get(target, key, recevier) {
        console.log('代理get', target, key)
        return target[key]
      },
      set(target, key, val, recevier) {
        target[key] = val
      }
    }
    const proxy = new Proxy(target, handler)
    // let age = proxy.age
    let aaa = proxy.age.age2.age3
    console.log(aaa)
    // let bbb = aaa.age3

  </script>
</body>

</html>